package com.zte.claa.inficombo.csa.app.service.dev.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.zte.claa.inficombo.csa.app.dao.mysql.impl.DevTypeMapper;
import com.zte.claa.inficombo.csa.app.model.dev.CmdModelBean;
import com.zte.claa.inficombo.csa.app.model.dev.DataModelBean;
import com.zte.claa.inficombo.csa.app.model.dev.DevTpExtData;
import com.zte.claa.inficombo.csa.app.model.dev.DevTypeBase;
import com.zte.claa.inficombo.csa.app.model.dev.DevTypeModel;
import com.zte.claa.inficombo.csa.app.service.dev.CSADevtypeService;

@Service
public class CSADevtypeServiceImpl implements CSADevtypeService{

	@Autowired
	private DevTypeMapper devtpMapper;
	
	@Override
	public DevTypeBase getDevtypeBase(String devTypeId) throws Exception {
		return this.devtpMapper.getDevtypeBase(devTypeId);
	}

	@Override
	public List<DataModelBean> getDevtypeDataModel(String devTypeId) throws Exception {
		return this.devtpMapper.getDevtypeDataModel(devTypeId);
	}

	@Override
	public List<CmdModelBean> getDevtypeCmdModel(String devTypeId) throws Exception {
		return this.devtpMapper.getDevtypeCmdModel(devTypeId);
	}

	@Override
	public List<DevTypeBase> getAllDevtypeBase() throws Exception {
		return this.devtpMapper.getAllDevtypeBase();
	}

	@Override
	public DevTypeModel getDevtypeModel(String devTypeId) throws Exception {
		DevTypeModel dtm = new DevTypeModel();
		dtm.setDevTypeId(devTypeId);
		dtm.setBase(this.devtpMapper.getDevtypeBase(devTypeId));		
		dtm.setDmList(this.devtpMapper.getDevtypeDataModel(devTypeId));
		dtm.setCmList(this.devtpMapper.getDevtypeCmdModel(devTypeId));		
		return dtm;
	}
	
	// 查询特殊设备类型的扩展数据.
	public List<DevTpExtData> getDevTpExtDatas() throws Exception {
		return this.devtpMapper.getDevTpExtDatas();
	}
	
	// 查询特殊设备类型的扩展数据.
	public DevTpExtData getDevTpExtData(String devtpid) throws Exception {
		return this.devtpMapper.getDevTpExtData(devtpid);
	}

}
